package com.mx.cofee;

import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JLabel;

public class Cursor extends JLabel{

	private static final long serialVersionUID = 1L;
	private int x = -2;
	private int y;
	private boolean defaultCursor = true;
	private static final String defaultImage = "src/com/mx/cofee/resource/cursor.png";
	private static final String selectImage = "src/com/mx/cofee/resource/cursorSelect.png";
	private static ImageIcon image;

	public Cursor() {
		image = new ImageIcon(defaultImage);
		setIcon(image);
	}

	public Image getImage() {
		return image.getImage();
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x - 2;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y - 2;
	}

	public boolean isDefaultCursor() {
		return defaultCursor;
	}

	public void changeCursor() {
		this.defaultCursor = !defaultCursor;
		image = new ImageIcon(defaultCursor ? defaultImage : selectImage);
		setIcon(image);
	}
	
}
